package product

import (
	"gin_miaosa/zhiliao_web/middle_ware"

	"github.com/gin-gonic/gin"
)

func Router(router *gin.RouterGroup)  {
	router.GET("/get_product_list",GetProductList)
	router.POST("/product_add",middle_ware.JwtTokenValid,ProductAdd)
	router.POST("/product_del",middle_ware.JwtTokenValid,ProductDel)
	router.GET("/to_product_edit",middle_ware.JwtTokenValid,ProductToEdit)
	router.POST("/do_product_edit",middle_ware.JwtTokenValid,ProductDoEdit)

	// // curl -X GET http://localhost:8081/product/get_product_list
	// router.GET("/get_product_list",GetProductList)
	// // >curl -X POST -d "name=apple&price=5&num=10" http://localhost:8081/product/product_add
	// router.POST("/product_add",ProductAdd)
	// // 删除  curl -X POST -d "id=2" http://localhost:8081/product/product_del
	// router.POST("/product_del",ProductDel)
	// // curl -X GET http://localhost:8081/product/to_product_edit?id=3
	// router.GET("/to_product_edit",ProductToEdit)
	// // curl -X POST -d "id=3&name=apple&price=5&num=10" http://localhost:8081/product/do_product_edit
	// router.POST("/do_product_edit",ProductDoEdit)
}
